#ifndef _YATAK_LIST_H
#define _YATAK_LIST_H

#ifdef __cplusplus
extern "C" {
#endif

#include <types.h>

typedef struct list
{
	void * item;
	size_t size;
	struct list * next;
} list_t;

typedef struct dlist
{
	void * item;
	size_t size;
	struct dlist * next;
	struct dlist * back;
} dlist_t;

void * add2List (list_t * head, void * item, size_t size);
void * push2List (list_t * head, void * item, size_t size);
void * get_list_item (list_t * head, size_t number);
size_t get_list_item_s (list_t * head, size_t number);
void * pop_list (list_t * head);
void * remove_list_item (list_t * head, size_t number);
void * remove_list (list_t * head);

void * add2dList (dlist_t * head, void * item, size_t size);
void * push2dList (dlist_t * head, void * item, size_t size);
void * get_dlist_item (dlist_t * head, size_t number);
void * pop_dlist (dlist_t * head);
void * remove_dlist_item (dlist_t * head, size_t number);
void * remove_dlist (dlist_t * head);

#ifdef __cplusplus
}
#endif

#endif
